package android.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class HelloWorldTJITTY extends Activity {
    EditText et_Username;

    Button   btn_submit;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //        et_Username = (EditText) findViewById(R.id.etUsername);
        //        et_Username.setOnClickListener(new EditText.OnClickListener() {
        //            @Override
        //            public void onClick(View v) {
        //                et_Username.selectAll();
        //            }
        //        });

        btn_submit = (Button) findViewById(R.id.btnSubmit);
        btn_submit.setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(HelloWorldTJITTY.this, Welcome.class);

                et_Username = (EditText) findViewById(R.id.etUsername);

                Bundle bundle = new Bundle();
                bundle.putString("username", et_Username.getText().toString());
                intent.putExtras(bundle);

                startActivity(intent);
                finish();
            }
        });
    }

    public void selectAll(View v) {
        et_Username = (EditText) findViewById(R.id.etUsername);
        et_Username.selectAll();
    }
}